import Vue from 'vue'
import VueRouter from 'vue-router'
const Home = () => import(/* webpackChunkName: "home" */'../components/Home.vue')
const Rating = () => import(/* webcheckChunkName: "ratings" */ '../components/ratings/Ratings.vue')
const Seller = () => import(/* webpackChunkName: "seller" */ '../components/seller/Seller.vue')
const Goods = () => import(/* webpackChunkName: "goods" */ '../components/goods/Goods.vue')

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    component: Home,
    children: [
      { path: '/home', redirect: '/goods' },
      { path: '/goods', component: Goods },
      { path: '/ratings', component: Rating },
      { path: '/seller', component: Seller }
    ]
  }
]

const router = new VueRouter({
  linkActiveClass: 'active',
  routes
})

export default router
